package com.huawei.classroom.student.h06;

public class Barrack extends Building{
	 public Barrack(int xx,int yy) {
		 x=xx;
		 y=yy;
		 health=100;
		 force=0;
		 range=0;
	 }
	 public Role traing(EnumObjectType type) {
		 if(type==EnumObjectType.rifleSoldier)
			 return new RifleSoldier(x,y);
		 if(type==EnumObjectType.RPGSoldier)
			 return new RPGSoldier(x,y);
		 if(type==EnumObjectType.dog)
			 return new Dog(x,y);
		 else {
			 System.out.println("Error, only rifleSoldier/RPGSoldier/dog");
			 return null;
		 }
	 }
	 
}
